#include<assert.h>
#include<stdio.h>
#include<string.h>
#include<ctype.h>
int main(){
    char s[2000];
    fgets(s,80,stdin);//gets(s);
    int number,letter,space,other;
    int i,n=strlen(s);
    number=letter=space=other=0;
    for(i=0;i<n;i++){
        if(isdigit(s[i]))++number;
        else if(isalpha(s[i]))++letter;
        else if(isspace(s[i]))++space;
        else other++;
    }
    printf("%d %d %d %d\n",number,letter,space,other);

    return 0;
}
